from pysqlite2 import dbapi2 as sqlite

dbname = 'database_test_11'

db = sqlite.connect(dbname)
db.execute("update link set flag=0")
query = "update link set flag=1 where rowid in (select linkid from cosSim where value<0.3)"
db.execute(query)
db.commit()
